package itsm.isperp.module.controller.incident;

import itsm.isperp.module.entity.app.AppConfig;
import itsm.isperp.module.service.app.AppConfigService;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * 
 * 
 * 
 * @author lizx
 * @date 2015-1-31
 * @since 1.0
 * 
 */
@Controller
@RequestMapping("incident/config")
public class IcdConfigController {

	@Autowired
	protected AppConfigService appConfigService;

	@RequestMapping(value = { "statusProcesser" })
	public ModelAndView statusProcesser(HttpServletRequest req) {
		ModelAndView mv = new ModelAndView(
				"incident/config/statusProcesser");

		List<AppConfig> list = appConfigService.findAll();
		for (AppConfig appConfig : list) {
			mv.addObject(appConfig.getItemKey(), appConfig.getItemValue());
		}
		return mv;
	}

}
